# $Id$
# Maintainer: Thomas Bächler <thomas@archlinux.org>

pkgname=wpa_supplicant_gui
pkgver=2.5
pkgrel=3
pkgdesc="A Qt frontend to wpa_supplicant"
url="http://hostap.epitest.fi/wpa_supplicant"
arch=('i686' 'x86_64')
depends=('qt5-base' "wpa_supplicant")
license=('GPL')
source=("http://hostap.epitest.fi/releases/wpa_supplicant-$pkgver.tar.gz")
sha256sums=('cce55bae483b364eae55c35ba567c279be442ed8bab5b80a3c7fb0d057b9b316')

build() {
  cd wpa_supplicant-${pkgver}
  cd wpa_supplicant/wpa_gui-qt4
  qmake-qt5 QMAKE_CFLAGS_RELEASE="$CPPFLAGS $CFLAGS" QMAKE_CXXFLAGS_RELEASE="$CPPFLAGS $CXXFLAGS" QMAKE_LFLAGS_RELEASE="$LDFLAGS"
  make
}

package() {
  cd "${srcdir}/wpa_supplicant-${pkgver}/wpa_supplicant/wpa_gui-qt4"
  install -Dm755 wpa_gui "${pkgdir}/usr/bin/wpa_gui"
  install -Dm644 icons/wpa_gui.svg "${pkgdir}/usr/share/pixmaps/wpa_gui.svg"
  install -Dm644 wpa_gui.desktop "${pkgdir}/usr/share/applications/wpa_gui.desktop"
  install -Dm644 "${srcdir}/wpa_supplicant-${pkgver}/wpa_supplicant/doc/docbook/wpa_gui.8" \
     "${pkgdir}/usr/share/man/man8/wpa_gui.8"
}
